import { MenuButton, Org, ParamExts, Product, Roles, Users } from "@/api/types/base";
import { Model } from "@/views/model/modeTypes";

export type LayoutType = "vertical" | "classic" | "transverse" | "columns";

export type AssemblySizeType = "large" | "default" | "small";

export type LanguageType = "zh" | "en" | null;

/* GlobalState */
export interface GlobalState {
  layout: LayoutType;
  assemblySize: AssemblySizeType;
  language: LanguageType;
  maximize: boolean;
  primary: string;
  isDark: boolean;
  isGrey: boolean;
  isWeak: boolean;
  asideInverted: boolean;
  headerInverted: boolean;
  isCollapse: boolean;
  accordion: boolean;
  breadcrumb: boolean;
  breadcrumbIcon: boolean;
  tabs: boolean;
  tabsIcon: boolean;
  footer: boolean;
}

/* UserState */
export interface UserState {
  _d: string;
  token: string;
  userInfo: {
    _id?: string;
    orgId?: string;
    loginName?: string;
    email?: string;
    sex?: number;
    userName?: string;
    userPicId?: string;
    workNo?: string;
    nickName?: string;
  };
}

/* tabsMenuProps */
export interface TabsMenuProps {
  icon: string;
  title: string;
  path: string;
  name: string;
  close: boolean;
  isKeepAlive: boolean;
}

/* TabsState */
export interface TabsState {
  tabsMenuList: TabsMenuProps[];
}

/* AuthState */
export interface AuthState {
  routeName: string;
  authButtonList: MenuButton[];
  authMenuList: Menu.MenuOptions[];
}

/* KeepAliveState */
export interface KeepAliveState {
  keepAliveName: string[];
}

export interface DataState {
  enumData: Map<string, ParamExts[]>;
  userList: Users[];
  productList: Product[];
  orgList: Org[];
  orgTree: Org[];
  commonData: Map<string, any[]>;
  roleList: Roles[];
  userId: string;
  abstractElements: Model.AbstractElement[];
  dataElements: Model.DataElement[];
}
